import { createRouter, createWebHistory } from 'vue-router'
import {isMobile} from '@/utils'
import mRouters from './m'
import pcRouters from './pc'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: isMobile() ? mRouters : pcRouters
})


window.onresize=()=>{
  router.options.routes = isMobile() ? mRouters : pcRouters
  router.go(0)
}

export default router
